package com.atguigu.yygh.msm.component;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author Steven
 */
@Component
public class MsmConstantPropertiesUtils implements InitializingBean {
    public static String SERVER_IP;
    public static String SERVER_PORT;
    public static String ACCOUNT_SID;
    public static String ACCOUNT_TOKEN;
    public static String APP_ID;
    public static String TEMPLATE_ID;
    public static String SUB_APPEND;
    @Value("${lianrong.sms.serverIp}")
    private String serverIp;
    @Value("${lianrong.sms.serverPort}")
    private String serverPort;
    @Value("${lianrong.sms.accountSId}")
    private String accountSId;
    @Value("${lianrong.sms.accountToken}")
    private String accountToken;
    @Value("${lianrong.sms.appId}")
    private String appId;
    @Value("${lianrong.sms.templateId}")
    private String templateId;
    @Value("${lianrong.sms.subAppend}")
    private String subAppend;

    @Override
    public void afterPropertiesSet() throws Exception {
        SERVER_IP = serverIp;
        SERVER_PORT = serverPort;
        ACCOUNT_SID = accountSId;
        ACCOUNT_TOKEN = accountToken;
        APP_ID = appId;
        TEMPLATE_ID = templateId;
        SUB_APPEND = subAppend;

    }
}